import pymysql
import re


# 比较两个文件，判断多余id
# 数量多的
# keys=[]
# values=[]
# for key in keys:
#     if key not in values:
#         print(key)


#将html文件的内容保存为文件
# html=open("C:\\Users\\diao\\Desktop\\清世宗实录_阅读书籍_全历史.html","r",encoding='utf-8')
# soup = BeautifulSoup(html,'lxml')
# datas=[]
# #将每个详情页的内容放入集合
# for x in soup.find_all('div',class_="dls-p"):
#     if x.find('p',class_='p1'):
#         a=x.find('p',class_='p1').get_text()
#     else:
#         a=x.get_text()
#     #a为标签内容
#     datas.append(a)
#     del a
# #每个详情页内容拼接
# datas='\n'.join(datas)
# with open("C:\\Users\\diao\\Desktop\\333.txt","w",encoding='utf-8') as file:
#     file.write(datas)


#解析文件中的id值
# pat=r'id: "(.*?)"'
# r=open("C:\\Users\\diao\\Desktop\\100bc.txt","r",encoding='utf-8')
# w=open("C:\\Users\\diao\\Desktop\\id_test1.txt","a",encoding='utf-8')
# for line in r:
#    id=re.findall(pat,line.replace('\n',''))
#    if id:
#        print(id[0])
#        w.write(id[0]+'\n')
# r.close()
# w.close()



# conn = pymysql.Connect(host = '10.170.128.56',
#                        port = 3306,
#                        user = 'root',
#                        passwd = '123456',
#                        db = 'books',
#                        charset='utf8mb4')
# cur1 = conn.cursor()
# sql="select book_id,count(*) from books_tmp where catalogs is null and `index` is not null group by book_id"
# cur1.execute(sql)
# result=cur1.fetchall()
# print(len(result))
# for i in result:
#     book_id=i[0]
#     catalogs=i[1]
#     into = "update books_tmp set catalogs="+str(catalogs)+" where book_id='"+book_id+"' and catalogs is null and `index` is not null"
#     cur1.execute(into)
#     conn.commit()
#     print(into)
# cur1.close()
# conn.close()

a=['右翊卫',
   '左骁卫',
   '右骁卫',
   '左武卫',
   '右武卫',
   '左屯卫',
   '右屯卫',
   '左御卫',
   '右御卫',
   '左侯卫',
   '右候卫']

for b in a :
    c=b+"大将军"
    d=b+"将军"
    print(c)
    print(d)


